﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AdvplDoc.Model {

	class AdvplFunction {
		public string name { get; set; }
		public string description { get; set; }
		public List<AdvplParam> parameters { get; set; }
		public AdvplReturnInfo returnInfo { get; set; }
		public List<string> observation { get; set; }
		public List<string> examples { get; set; }
		public string since { get; set; }
		public bool isDeprecated { get; set; }
		public string deprecatedInfo { get; set; }
		public List<string> seeAlso { get; set; }

		public AdvplFunction(	string name,
								string desc,
								List<AdvplParam> parameters,
								AdvplReturnInfo return_info,
								List<string> obs_list,
								List<string> examples,
								string since,
								bool is_deprecated,
								string deprecated_info,
								List<string> seealso) {
			this.name = name;
			this.description = desc;
			this.parameters = parameters;
			this.returnInfo = return_info;
			this.observation = obs_list;
			this.examples = examples;
			this.since = since;
			this.isDeprecated = is_deprecated;
			this.deprecatedInfo = deprecated_info;
			this.seeAlso = seealso;
		}

        public List<string> getParametersNames() {
            List<string> names = new List<string>();

            foreach (AdvplParam p in this.parameters)
                names.Add(p.name);

            return names;
        }


		public override string ToString() {
			return "Função ADVPL " + this.name;
		}
	}
}
